﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace nMongo
{
    /// <summary>
    /// Represent a MongoPersistencyStatistics object with persistency states.
    /// </summary>
    public class MongoPersistencyStatistics
    {
        #region Properties
        /// <summary>
        /// Object type of this persistency control.
        /// </summary>
        public Type ObjectType { get; set; }

        /// <summary>
        /// Object public identity.
        /// </summary>
        public object Id { get; set; }

        /// <summary>
        /// Type of this persistency control state.
        /// </summary>
        public MongoPersistencyState State { get; set; }

        /// <summary>
        /// Initial object instance when this persistency control state was created.
        /// </summary>
        public object InitialInstance { get; set; }

        /// <summary>
        /// Current object instance after the last persistency control check.
        /// </summary>
        public object CurrentInstance { get; set; }


        public KeyValuePair<Type, object> GetListKey()
        {
            return new KeyValuePair<Type, object>(ObjectType, Id);
        }
        #endregion
    }
}
